﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="WFRes/_Content/themes/ligerUI/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="WFRes/_Content/themes/ligerUI/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="WFRes/_Content/themes/H3Default/H3-All.css" rel="stylesheet" type="text/css" />
    <script src="WFRes/_Scripts/jquery/jquery.js?v=1.12.4"></script>
    <script src="WFRes/_Scripts/jquery/jquery.lang.js"></script>
    <script src="WFRes/_Scripts/vue/vue.js"></script>
    <script src="WFRes/_Scripts/vue/vue-validator.min.js?=201901252212"></script>
    <script src="WFRes/_Scripts/vue/Validator.js"></script>
    <script src="WFRes/_Scripts/ligerUI/ligerui.min.js"></script>
    <script src="WFRes/_Scripts/H3AdminPlugins.js" type="text/javascript"></script>
    <script src="WFRes/_Scripts/H3TreeTools.js"></script>
    <link href="WFRes/_Content/themes/H3Default/H3-HeadInfo.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $.ajaxSetup({
            complete: function (XMLHttpRequest, textStatus) {
                //注册统一500错误事件
                if (textStatus == "error" && XMLHttpRequest.status == "500") {
                    try {
                        var errorHtml = $.parseHTML(XMLHttpRequest.responseText);
                        var errorTitle = errorHtml[1].innerHTML;
                        $.H3Dialog.Error({ content: errorTitle + "  系统错误!" });
                    } catch (e) {
                        $.H3Dialog.Error({ content: "系统错误!" });
                    }
                }
                //FormAuthentication过期
                if (XMLHttpRequest.status == 401) {
                }
                // 注册统一监听事件
                if (XMLHttpRequest.responseText) {
                    try {
                        var result = JSON.parse(XMLHttpRequest.responseText);
                        if (result && !result.Success && result.ExceptionCode == 1) {
                            location.href = result.Extend + "/Login.html";
                        }
                    } catch (e) { }
                }
            }
        });

        var _CLUSTERROOT_GLOBAL = top.window._CLUSTERROOT_GLOBAL || "";
        var url = getUrlParam("url");
        var code = getUrlParam("code");
        var SchemaCode = getUrlParam("SchemaCode");
        if (code) document.title = $.Lang(code);
        var urlLowerCase = url.toLowerCase();
        var ajaxActions = [];

        // URL兼容
        if (urlLowerCase.indexOf("http") != 0 && urlLowerCase.indexOf(_CLUSTERROOT_GLOBAL.toLowerCase()) != 0) {
            if (url.indexOf("/") == 0 || url.indexOf("\\") == 0) {
                url = url.substring(1);
            }
            //url = _CLUSTERROOT_GLOBAL + "/" + url;
        }
        //js获取URL参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return decodeURI(r[2]); return null; //返回参数值
        };

        //获取服务器时间
        function initDefaultDate() {
            $.ajax({
                url: $.Controller.AdminIndex.GetSystemDate,
                type: "GET",
                cache: false,
                dataType: "JSON",
                async: false,//同步执行
                success: function (data) {
                    if (data.Success) {
                        $("*[data-datetime]").each(function (n, k) {
                            var key = $.Lang($(this).attr("data-datetime"));
                            if (key == "start") {
                                $(this).val(data.Extend.StartTime);
                            } else {
                                $(this).val(data.Extend.EndTime);
                            }
                        });
                    }
                }
            });
        }

        //加载HTML页面
        $(function () {
            $.ajax({
                url: url,
                type: 'get',
                async: false,//同步执行
                success: function (data) {
                    $("#content").html(data);
                    $.initLanguage();
                }
            });
        });
    </script>
</head>
<body style="overflow-x:hidden">
    <div id="content" style="width:100%;"></div>
</body>
</html>
